<template>
  <div>
    <nav-bar></nav-bar>
    <div class="box">
      <div class="title">意见反馈</div>
      <div class="container">
        <van-field
          v-model="content"
          rows="3"
          autosize
          label="留言"
          type="textarea"
          maxlength="150"
          placeholder="请输入留言"
          show-word-limit
        />
        <van-field
          v-model="phone"
          type="tel"
          label="联系方式："
          placeholder="邮箱/手机号/微信号"
        />
      </div>
      <van-button color="#b4282d" size="large" @click="submit">提交</van-button>
    </div>
  </div>
</template>

<script>
import Navbar from "../../../components/Navbar";
import { submitAction } from "@/api/my";
import { Toast } from "vant";
export default {
  props: {},
  data() {
    return {
      content: "",
      phone: "",
      name: "小何",
    };
  },
  computed: {},
  created() {},
  mounted() {},
  watch: {},
  methods: {
    submit() {
      submitAction({
        content: this.content,
        phone: this.phone,
        name: this.name,
      }).then((res) => {
        if (res.data == true) {
          console.log(res.data);
          Toast.success("提交成功");
        }
      });
      this.content = this.phone = "";
    },
  },
  components: {
    "nav-bar": Navbar,
  },
};
</script>

<style lang="scss" scoped>
.box {
  height: 100%;
  background: #fff;
  padding: 0 10px;
  .title {
    padding: 10px 0;
    border-bottom: 1px solid #d9d9d9;
    text-align: left;
    font-size: 15px;
  }
}
</style>
